﻿using Nuwanda.Common;
using Nuwanda.TfsSpotlight.Shell;
using Nuwanda.TfsSpotlight.Shell.Services.Interfaces;
using Nuwanda.TfsSpotlight.Views.About;
using StructureMap;

namespace Nuwanda.TfsSpotlight.Commands
{
    /// <summary>Opens about window</summary>
    [Author("Bartłomiej Legiędź")]
    [Pluggable(CommandsNames.OpenAboutWindow)]
    public class OpenAboutWindowCommand : ICommand
    {
        private IApplicationController ApplicationController { get; set; }

        public OpenAboutWindowCommand(IApplicationController applicationController)
        {
            ApplicationController = applicationController;
        }

        public void Execute()
        {
            var aboutView = new AboutView();
            var presenter = new AboutPresenter(aboutView);
            presenter.Initialize(this.ApplicationController.IsBeta);
            aboutView.ShowDialog();
        }
    }
}